// 用来封装所有与组织架构相关的请求

import request from '@/utils/request.js'

// 获取所有的组织架构
export function companyDepartmentApi() {
  return request({
    url: '/company/department'
  })
}

// 封装删除组织架构
export function delDeapartApi(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

// 封装新增接口
export function addDeapartApi(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 封装根据ID修改部门
export function changeDepartment(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
